#ifndef INC_UMLOBJECT_H
#define INC_UMLOBJECT_H

#include "../base/Observable.h"
#include "BUMLSText.h"

#include <QPoint>   // Yeah, in the model. It's useful!
#include <QSize>

class DiagramVisitor;

class UMLObject : public Observable
{
	public:
		
		/*** CONSTRUCTION AND DESTRUCTION ***/

		UMLObject(const QString& text = QString());
		// default copy constructor

		virtual ~UMLObject();

		/**
		 * New's a clone of this object. A "virtual constructor".
		 */
		virtual UMLObject* clone() const = 0;

		/*** ACCESSORS ***/

		QPoint position() const;

		/**
		 * Note that this may be a complex operation for some objects.
		 */
		void setPosition(const QPoint&);

		virtual QSize size() const = 0;

		/**
		 * @return a const reference to the object's internal BUMLSText. No, you
		 * may not modify it.
		 */
		const BUMLSText& text() const;
		void setText(const BUMLSText& text);

		virtual void accept(DiagramVisitor&) = 0;

	protected:
		/**
		 * Hook function for complex subclasses to update necessary members
		 * when position changed.
		 */
		virtual void translate();

	private:
		QPoint _position;
		BUMLSText _text;
};

#endif // INC_UMLOBJECT_H

